package com.yazi.mxz.person.data.form.shop;

import javax.validation.constraints.NotNull;

import com.yazi.mxz.common.entity.beans.Spec;
import com.yazi.mxz.person.data.form.Form;

/**
 * 表单对象－商品规格<br>
 * 添加必填：
 * specType.specTypeId、name<br>
 * 修改必填：
 * specId、name
 * 
 *
 * @author mo_yq5
 * @since 2016年6月3日
 */
public class SpecForm extends Form<Spec> {

	/**
	 * 表单类型－商品规格－编辑
	 */
	public interface Edit {
	}

	/**
	 * 表单类型－商品规格－添加
	 */
	public interface Add {
	}

	public SpecForm() {
		super(new Spec());
	}

	private Long specId;
	private SpecTypeForm specType;
	private String name;
	private String icon;
	private Long sort;

	@NotNull(groups = Edit.class)
	public Long getSpecId() {
		return specId;
	}

	public void setSpecId(Long specId) {
		get().setSpecId(specId);
		this.specId = specId;
	}

	@NotNull(groups = Add.class)
	public SpecTypeForm getSpecType() {
		return specType;
	}

	public void setSpecType(SpecTypeForm specType) {
		get().setSpecType(specType.get());
		this.specType = specType;
	}

	@NotNull
	public String getName() {
		return name;
	}

	public void setName(String name) {
		get().setName(name);
		this.name = name;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		get().setIcon(icon);
		this.icon = icon;
	}

	public Long getSort() {
		return sort;
	}

	public void setSort(Long sort) {
		get().setSort(sort);
		this.sort = sort;
	}
}
